/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.catosist.run.dataaccess.domain.hibernate;

import com.catosist.run.dataaccess.base.hibernate.HibernateGenericDAO;
import com.catosist.run.dataaccess.domain.ComprobanteDetalleDao;
import com.catosist.run.dataaccess.model.ComprobantedetalleVO;
import java.io.Serializable;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import java.util.List;

/**
 *
 * @author igorov
 */
public class HibernateComprobanteDetalleDao extends HibernateGenericDAO<ComprobantedetalleVO, Integer> implements ComprobanteDetalleDao{
    public HibernateComprobanteDetalleDao() {
        super(ComprobantedetalleVO.class);
    }

    public List<ComprobantedetalleVO> getByComprobanteId(int comprobanteId) {
        DetachedCriteria detachedCriteria = DetachedCriteria.forClass(ComprobantedetalleVO.class);
        detachedCriteria.add(Restrictions.eq("comprobante.id", comprobanteId));
        List<ComprobantedetalleVO> comprobantedetalleVOs = listByCriteria(detachedCriteria);
        return comprobantedetalleVOs;
    }
}
